#include "drama.h"

Drama::Drama()
{
	nowPlay = 1;
	nowRead = 0;
	readFromFile();
}

void Drama::readFromFile()
{
	nowRead = 0;
	cmd.swap(vector<string>());
	stringstream ss;
	string s;
	ss << nowPlay;
	ss >> s;
	s = s + ".txt";
	ifstream infile;
	infile.open(s.c_str());
	while (getline(infile, s))
	{
		cmd.push_back(s);
	}
}

void Drama::readNextDrama()
{
	nowPlay++;
	if (nowPlay < MAX_Drama)
	{
		readFromFile();
	}
}

void Drama::readSetDrama(int i)
{
	nowPlay = i;
	readFromFile();
}